﻿namespace EyeOpen.Data
{
	using System;
	using EyeOpen.Domain;

	public class EntityBuilder<T>
		where T : UniqueEntity, new()
	{
		public T Create(Action<T> action)
		{
			var entity = 
				new T
					{
						Id = Guid.NewGuid()
					};

			action(entity);
			
			return entity;
		}
	}
}